package com.midou.administration.entity;

import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 *
 * </p>
 *
 * @author MrChen
 * @since 2021-03-24
 */

/**
 * 订单表
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("`order`")
public class Order implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "order_id", type = IdType.AUTO)
    private Integer orderId;

    /**
     * 用户外键(谁下的订单)
     */
    private Integer userId;

    /**
     * 桌位外键
     */
    private Integer deskId;

    /**
     * 订单号
     */
    private String orderNumber;

    /**
     * 下订单的时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date orderTime;

    /**
     * 状态:0未完成,1已完成
     */
    private Integer orderState;

    /**
     * 商家外键
     */
    private Integer businessId;

    /**
     * 支付方式:现金会员支付宝
     */
    private Integer orderPaymentMethod;

    /**
     * 订单金额
     */
    private Double orderPrice;

    /**
     * 操作员工
     */
    private Integer clerkId;

    /**
     * 备注
     */
    private String orderRemarks;

    /**
     * 员工
     */
    @TableField(exist = false)
    private Clerk clerk;

    /**
     * 座位
     */
    @TableField(exist = false)
    private Desk desk;

    /**
     * 订单详情
     */
    @TableField(exist = false)
    private List<OrderInfo> infos = new ArrayList<>();

    /**
     * 商家
     */
    @TableField(exist = false)
    private Business business;

}
